<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="generic_script.js"></script>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="http://jzaefferer.github.com/jquery-validation/jquery.validate.js"></script>
<style type="text/css">
* { font-family: Verdana; font-size: 96%; }
label { width: 10em; float: left; }
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
p { clear: both; }
.submit { margin-left: 12em; }
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
</style>
  <script>
  $(document).ready(function(){
    $("#beanEntryForm").validate();
  });
  </script>
<title><c:out value="${title}"/></title>
</head>
<body onload="changeLabels()">
	<c:choose>
		<c:when test="${beanclass !=null}">
			<jsp:useBean id="utils" class="pkg.genericity.utils.BeanUtil" scope="page" />
			<c:set property="bean" target="${utils}" value="${beanclass}"></c:set>
			<form id="beanEntryForm" action="BeanEntryController" method="get">
				<table>
					<c:forEach items="${utils.beanFieldsInfo}" var="fieldinfo">
						<tr>
							<td><label><c:out value="${fieldinfo.name}" /></label></td>
							<td><input type='text' name='<c:out value="${fieldinfo.name}"/>' class='<c:out value="${fieldinfo.typeInfo}"/>' /></td>
						</tr>
					</c:forEach>
					<tr>
						<td><input type="submit" value="submit"></td>
					</tr>
				</table>
			</form>
		</c:when>
		<c:otherwise>
			<c:set var="errmsg" value="No Bean Defined Yet. Please define the bean first"></c:set>
			<c:set var="nexturl" value="index.jsp"></c:set>
			<c:redirect url="error_page.jsp" />
		</c:otherwise>
	</c:choose>
	<div><a href="">Home Page</a></div>
</body>
</html>